import { ctcssSsoRequest } from '@core/utils/request';

interface LoginParams {
  userName: string,
  password: string,
}

export default class Sso {
  static login = async (loginForm: { username: string, password: string }) => {
    const { username, password } = loginForm;
    const response = await ctcssSsoRequest.post<LoginParams, string>(
      '/standalone/sso/sso/login',
      { userName: username, password },
    );
    return response;
  };

  static verify = () => {
    return ctcssSsoRequest.get('/standalone/sso/sso/verify');
  };

  static logout = () => {
    ctcssSsoRequest.get('/standalone/sso/sso/logout');
  };
}
